package cn.iocoder.yudao.module.api.promotion.redpacket.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * 红包类型枚举
 *
 * @author 山野羡民
 */
@RequiredArgsConstructor
@Getter
public enum RedPacketTypeEnum implements EnumValuable {

    Breakfast(1, "早餐红包"),
    Lunch(2, "午餐红包"),
    Dinner(3, "晚餐红包"),
    ;

    @EnumValue
    private final Integer value;
    private final String name;

    public static String getNameByValue(Integer value) {
        for (RedPacketTypeEnum item : values()) {
            if (item.value.equals(value)) {
                return item.name;
            }
        }
        return "未知红包";
    }

}
